﻿using Newtonsoft.Json.Linq;

namespace XbmcManager.Modules
{
    public class XbmcGui
    {
        private XbmcController xbmc;
        private XbmcConnection connection;

        /// <summary>
        /// Constructor
        /// </summary>
        /// <param name="Xbmc"></param>
        /// <param name="mConnection"></param>
        internal XbmcGui(XbmcController Xbmc, XbmcConnection mConnection)
        {
            this.xbmc = Xbmc;
            this.connection = mConnection;
        }

        /// <summary>
        /// Displays a popup notification to XBMC
        /// </summary>
        /// <param name="title">The Title of the Message, displayed up top.</param>
        /// <param name="message">The message to be displayed.</param>
        public void Notification(string title, string message)
        {
            JObject args = new JObject();
            args.Add(new JProperty("title", title));
            args.Add(new JProperty("message", message));
            connection.SendJson("GUI.ShowNotification", args);
        }

        /// <summary>
        /// Toggles fullscreen for XBMC
        /// </summary>
        public void FullScreen()
        {
            JObject args = new JObject();
            args.Add(new JProperty("fullscreen", true));
            connection.SendJson("GUI.SetFullscreen", args);
        }
    }
}
